import BaseModel from './.model';
import { Table, Column, DataType, ForeignKey } from 'sequelize-typescript';
import RoleModel from './role.model';
import PermissionModel from './permission.model';

@Table({ tableName: 'role_permissions' })
export default class RolePermissionModel extends BaseModel {
  /** 角色ID */
  @ForeignKey(() => RoleModel)
  @Column({ type: DataType.UUID, comment: '角色ID' })
  roleId!: string;

  /** 权限ID */
  @ForeignKey(() => PermissionModel)
  @Column({ type: DataType.UUID, comment: '权限ID' })
  permissionId!: string;
}